﻿using System.Data;

namespace ltModel.BLL
{
    /// <summary>
    /// 业务逻辑类article_content 的摘要说明。
    /// </summary>
    public class article_content
    {
        private readonly ltModel.DAL.article_content dal = new ltModel.DAL.article_content();
        public article_content()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int News_id)
        {
            return dal.Exists(News_id);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ltModel.Model.article_content model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ltModel.Model.article_content model)
        {
            return dal.Update(model);
        }
        /// <summary>
        /// 修改点击量
        /// </summary>
        /// <param name="id">新闻ID</param>
        /// <returns></returns>
        public bool UpdateNewsHit(int id)
        {
            return dal.UpdateNewsHit(id);
        }
        /// <summary>
        /// 修改链接
        /// </summary>
        /// <param name="id"></param>
        /// <param name="link"></param>
        /// <returns></returns>
        public bool UpdateLink(int id, string link)
        {
            return dal.UpdateLink(id, link);
        }
        /// <summary>
        /// 修改管理用户发布量
        /// </summary>
        /// <param name="user">管理用户</param>
        /// <returns></returns>
        public bool UpdateManFab(string user)
        {
            return dal.UpdateManFab(user);
        }

        /// <summary>
        /// 修改管理用户审核量
        /// </summary>
        /// <param name="user">管理用户</param>
        /// <returns></returns>
        public bool UpdateManSh(string user)
        {
            return dal.UpdateManSh(user);
        }

        /// <summary>
        /// 修改管理用户审核量
        /// </summary>
        /// <param name="user">管理用户</param>
        /// <param name="num">新加审核量</param>
        /// <returns></returns>
        public bool UpdateManSh(string user, int num)
        {
            return dal.UpdateManSh(user, num);
        }

        /// <summary>
        /// 修改审核推荐
        /// </summary>
        /// <param name="shval">审核值</param>
        /// <param name="tjval">推荐值</param>
        /// <param name="ids">新闻ID</param>
        /// <returns></returns>
        public bool UpdateShTj(string shval, string tjval, string ids, string user)
        {
            return dal.UpdateShTj(shval, tjval, ids, user);
        }

        /// <summary>
        /// 修改类别
        /// </summary>
        /// <param name="id"></param>
        /// <param name="classid"></param>
        /// <returns></returns>
        public bool UpdateClassId(string id, string classid)
        {
            return dal.UpdateClassId(id, classid);
        }

        /// <summary>
        /// 修改时间
        /// </summary>
        /// <param name="time">时间</param>
        /// <param name="ids">新闻ID</param>
        /// <returns></returns>
        public bool UpdateTime(string time, string ids)
        {
            return dal.UpdateTime(time, ids);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int News_id)
        {
            return dal.Delete(News_id);
        }

        /// <summary>
        /// 删除新闻
        /// </summary>
        /// <param name="classid">新闻ID</param>
        /// <returns></returns>
        public bool Delete(string newsid)
        {
            return dal.Delete(newsid);
        }

        /// <summary>
        /// 删除新闻
        /// </summary>
        /// <param name="classid">新闻类别</param>
        /// <returns></returns>
        public bool DeleteClassNews(string classid)
        {
            return dal.DeleteClassNews(classid);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ltModel.Model.article_content GetModel(int News_id)
        {
            return dal.GetModel(News_id);
        }

        /// <summary>
        /// 查询新闻(指定多少条记录)
        /// </summary>
        /// <param name="cids">新闻类别(集合)</param>
        /// <param name="count">新闻条数</param>
        /// <returns></returns>
        public DataSet FindShowNews(string cids, int count)
        {
            return dal.FindShowNews(cids, count);
        }

        /// <summary>
        /// 查询标题图片
        /// </summary>
        /// <param name="cids">新闻类别ID</param>
        /// <param name="count">新闻条数</param>
        /// <returns></returns>
        public DataSet FindPicNews(string cids, int count)
        {
            return dal.FindPicNews(cids, count);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// <param name="topNum">获取记录条数</param>
        /// <param name="strWhere">条件</param>
        /// </summary>
        public DataSet GetList(string topNum, string strWhere)
        {
            return dal.GetList(topNum, strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return dal.GetList("");
        }

        /// <summary>
        /// 查询上条新闻
        /// </summary>
        /// <param name="newsCid">新闻类别</param>
        /// <param name="id">当前新闻ID</param>
        /// <returns></returns>
        public DataTable FindBackNews(string newsCid, string id)
        {
            return dal.FindBackNews(newsCid, id);
        }

        /// <summary>
        /// 查询下条新闻
        /// </summary>
        /// <param name="newsCid">新闻类别</param>
        /// <param name="id">当前新闻ID</param>
        /// <returns></returns>
        public DataTable FindNexNews(string newsCid, string id)
        {
            return dal.FindNexNews(newsCid, id);
        }

        /// <summary>
        /// 查询相关新闻
        /// </summary>
        /// <param name="kw">关键字</param>
        /// <param name="id">当前新闻ID</param>
        /// <returns></returns>
        public DataTable FindKWNews(string kw, string id)
        {
            return dal.FindKWNews(kw, id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  成员方法
    }
}